var mongoose = require('mongoose')

mongoose.connect('mongodb://localhost/itcast')

var Schema = mongoose.Schema

var logitcSchema = new Schema({
    form_name: {
        type: String,
        required: true
    },
    to_name: {
        type: String,
        required: true
    },
    form_tel: {
        type: Number,
        required: true
    },
    to_tel: {
        type: Number,
        required: true
    },
    form_address: {
        type: String,
        required: true
    },
    to_address: {
        type: String,
        required: true
    },
    type: {
        type: Number,
        enum: [0, 1, 2],
        default: 0
    }
})

module.exports = mongoose.model('Logictics', logitcSchema)